{
  (c) 2013 evgeny.lucenko@gmail.com
  Free
}

unit uFontFix;

interface

implementation

uses Vcl.Graphics, System.SysUtils, Vcl.Dialogs;

{$I Weaver.inc}


initialization
begin
  {$IFDEF FONT_DEFAULT_REPLACE}
  case TOSVersion.Major of
    5: begin {XP, 2003 server, XP64 }
      {$IFDEF W50_FONT_DEFAULT_fqProof}
         Vcl.Graphics.DefFontData.Quality:= fqProof;
      {$ELSE}
          {$IFDEF W50_FONT_DEFAULT_fqNonAntialiased}
              Vcl.Graphics.DefFontData.Quality:= fqNonAntialiased;
          {$ELSE}
              {$IFDEF W50_FONT_DEFAULT_fqDraft}
                  Vcl.Graphics.DefFontData.Quality:= fqDraft;
              {$ELSE}
                  {$IFDEF W50_FONT_DEFAULT_fqClearTypeNatural}
                      Vcl.Graphics.DefFontData.Quality:= fqClearTypeNatural;
                  {$ELSE}
                     {$IFDEF W50_FONT_DEFAULT_fqClearType}
                         Vcl.Graphics.DefFontData.Quality:= fqClearType;
                     {$ELSE}
                         {$IFDEF W50_FONT_DEFAULT_fqAntialiased}
                             Vcl.Graphics.DefFontData.Quality:= fqAntialiased;
                         {$ENDIF}
                     {$ENDIF}
                  {$ENDIF}
              {$ENDIF}
          {$ENDIF}
      {$ENDIF}
    end;
    6: begin
      case TOSVersion.Minor of
        0..1: begin {Vista, 2008 server, 7, 2008 server R2}
          {$IFDEF W60_FONT_DEFAULT_fqProof}
             Vcl.Graphics.DefFontData.Quality:= fqProof;
          {$ELSE}
              {$IFDEF W60_FONT_DEFAULT_fqNonAntialiased}
                  Vcl.Graphics.DefFontData.Quality:= fqNonAntialiased;
              {$ELSE}
                  {$IFDEF W60_FONT_DEFAULT_fqDraft}
                      Vcl.Graphics.DefFontData.Quality:= fqDraft;
                  {$ELSE}
                      {$IFDEF W60_FONT_DEFAULT_fqClearTypeNatural}
                          Vcl.Graphics.DefFontData.Quality:= fqClearTypeNatural;
                      {$ELSE}
                         {$IFDEF W60_FONT_DEFAULT_fqClearType}
                             Vcl.Graphics.DefFontData.Quality:= fqClearType;
                         {$ELSE}
                             {$IFDEF W60_FONT_DEFAULT_fqAntialiased}
                                 Vcl.Graphics.DefFontData.Quality:= fqAntialiased;
                             {$ENDIF}
                         {$ENDIF}
                      {$ENDIF}
                  {$ENDIF}
              {$ENDIF}
          {$ENDIF}
        end;
        2..3: begin  {8, 2012 server R2, 8.1}
          {$IFDEF W62_FONT_DEFAULT_fqProof}
             Vcl.Graphics.DefFontData.Quality:= fqProof;
          {$ELSE}
              {$IFDEF W62_FONT_DEFAULT_fqNonAntialiased}
                  Vcl.Graphics.DefFontData.Quality:= fqNonAntialiased;
              {$ELSE}
                  {$IFDEF W62_FONT_DEFAULT_fqDraft}
                      Vcl.Graphics.DefFontData.Quality:= fqDraft;
                  {$ELSE}
                      {$IFDEF W62_FONT_DEFAULT_fqClearTypeNatural}
                          Vcl.Graphics.DefFontData.Quality:= fqClearTypeNatural;
                      {$ELSE}
                         {$IFDEF W62_FONT_DEFAULT_fqClearType}
                             Vcl.Graphics.DefFontData.Quality:= fqClearType;
                         {$ELSE}
                             {$IFDEF W62_FONT_DEFAULT_fqAntialiased}
                                 Vcl.Graphics.DefFontData.Quality:= fqAntialiased;
                             {$ENDIF}
                         {$ENDIF}
                      {$ENDIF}
                  {$ENDIF}
              {$ENDIF}
          {$ENDIF}
        end;
      end;
    end
  end;
  {$ENDIF}
end;

end.
